package com.huirui.server.controller.mini.program;

import com.huirui.server.pojo.result.Result;
import com.huirui.server.pojo.vo.NewcomerAreaProductVo;
import com.huirui.server.service.NewcomerAreaProductService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/newcomer/product")
@Slf4j
@Validated
@Tag(name = "新客专区商品管理", description = "小程序新客专区商品相关API")
public class NewcomerAreaController {

    @Resource
    private NewcomerAreaProductService newcomerAreaProductService;

    @GetMapping("/list")
    @Operation(summary = "获取新客专区商品列表")
    public Result<List<NewcomerAreaProductVo>> listProduct(Long page, Long pageSize) {
        List<NewcomerAreaProductVo> res = newcomerAreaProductService.listProduct(page, pageSize);
        return Result.success(res);
    }
}
